package com.button.springboothdfs.service;

import org.apache.hadoop.fs.Path;

import java.io.IOException;

/**
 * @Description
 * @Author Administrator
 * @Date 2023/1/30 13:52
 **/
public interface HdfsFileService {

    /**
     * 文件上传
     * @Description 文件上传
     * @Param sourcePath
     * @Param destPath
     * @Return void
     * @Author Administrator
     * @Date 2023/1/30 13:55
     **/
    public void uploadFile(Path sourcePath, Path destPath) throws Exception;

    /**
     * 下载文件
     * @Description 下载文件
     * @Param filePath
     * @Param downloadPath
     * @Return void
     * @Author Administrator
     * @Date 2023/1/30 14:27
     **/
    void download(Path filePath, String downloadPath) throws IOException;

    /**
     * 检测文件是否存在
     * @Description 检测文件是否存在
     * @Param filePath
     * @Return java.lang.Boolean
     * @Author Administrator
     * @Date 2023/1/30 14:54
     **/
    Boolean isExist(Path filePath) throws Exception;

    /**
     * 重命名文件
     * @Description 重命名文件
     * @Param sourcePath
     * @Param destPath
     * @Return java.lang.Boolean
     * @Author Administrator
     * @Date 2023/1/30 15:01
     **/
    Boolean rename(Path sourcePath, Path destPath) throws Exception;

    /**
     * 删除文件
     * @Description  删除文件
     * @Param path
     * @Return java.lang.Boolean
     * @Author Administrator
     * @Date 2023/1/30 15:12
     **/
    Boolean delete(Path path) throws Exception;

    /**
     * 获取文件大小
     * @Description
     * @Param path
     * @Return java.lang.Long
     * @Author Administrator
     * @Date 2023/1/30 15:19
     **/
    Long getFileLength(String path) throws Exception;
}
